<#macro input name extend index value=''>
	<#if !value?has_content>
		<#local value=extend.defaultValue!/>
	</#if>
	<#local inputName=name+'['+index+'].value'/>
	<input name="${name}[${index}].name" type="hidden" value="${extend.code}"/>
	<#switch extend.inputType>
		<#case 'number'>
		<input name="${inputName}" class="number<#if extend.required> required</#if>" type="text" size="30" value="${value!}"/>
			<#break>
		<#case 'file'>
		<input name="${inputName}" class="readonly<#if extend.required> required</#if>" value="${value!}" readonly="readonly" type="text"/>
		<a class="btnAttach" href="file/upload.html?field=${inputName}" lookupGroup="" width="560" height="300">附件</a>
			<#break>
		<#case 'image'>
		<input name="${inputName}" class="readonly<#if extend.required> required</#if>" value="${value!}" readonly="readonly" type="text"/>
		<a class="btnAttach" href="file/upload.html?field=${inputName}&onlyImage=true" lookupGroup="" width="560" height="300">图片</a>
		<#if !preview?has_content>
			<#include "../include_page/preview.html"/>
		</#if>
		<@preview extend.code 'input[name="${inputName}"]' ''/>
			<#break>
		<#case 'password'>
		<input name="${inputName}" class="<#if extend.required> required</#if>" type="password" size="30" value="${value!}"/>
			<#break>
		<#case 'textarea'>
		<textarea name="${inputName}" class="<#if extend.required>required</#if>" cols="80" rows="8">${value!}</textarea>
			<#break>
		<#case 'editor'>
		<textarea name="${inputName}" class="editor<#if extend.required> required</#if>" style="width: 100%;" rows="20">${value!}</textarea>
			<#break>
		<#case 'date'>
		<input name="${inputName}" class="date<#if extend.required> required</#if>" type="text" size="20" dateFmt="yyyy-MM-dd HH:mm:ss" value="${value!}"/>
		<a class="inputDateButton" href="javascript:;">选择</a>
			<#break>
		<#default>
		<input name="${inputName}" class="<#if extend.required> required</#if>" type="text" size="30" value="${value!}"/>
	</#switch>
</#macro>
<#macro extendData name extendList extendValues>
	<#list extendList as e>
	<dl${['textarea','editor','file','image']?seq_contains(e.inputType)?then(' class="nowrap"','')}>
		<dt>${e.name}：</dt>
		<dd<#if 'editor'=e.inputType> style="width:80%;"</#if>>
			<@input name e e?index extendValues[e.code]!/>
			<span class="info">${e.description!}</span>
		</dd>
	</dl>
	</#list>
</#macro>